package com.hanggold.springboot.environment;

import com.hanggold.springboot.environment.ps.MyPropertySource;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.env.EnvironmentPostProcessor;
import org.springframework.core.Ordered;
import org.springframework.core.env.ConfigurableEnvironment;

public class MyEnvironmentPostProcessor implements EnvironmentPostProcessor , Ordered {


    @Override
    public void postProcessEnvironment(ConfigurableEnvironment environment, SpringApplication application) {
        environment.getPropertySources().get("xx");

        MyPropertySource  myPropertySource = new MyPropertySource("systemProperties","null");

        environment.getPropertySources().addFirst(myPropertySource);

//        environment.getPropertySources().addFirst();
    }

    @Override
    public int getOrder() {
        return 0;
    }
}
